package cn.kgc.news.service.impl;
import cn.kgc.news.dao.NewsDao;
import cn.kgc.news.dao.impl.NewsDaoImpl;
import cn.kgc.news.pojo.News;
import cn.kgc.news.service.NewsService;
import java.util.List;
public class NewsServiceImpl implements NewsService {
    private NewsDao newsDao;
    public NewsServiceImpl(){
        newsDao=new NewsDaoImpl();
    }
    @Override
    public List<News> getNewsList() {
        return newsDao.getNewsList();
    }
    @Override
    public List<News> getNewsListByTitle(String tit) {
        return newsDao.getNewsListByTitle(tit);
    }
    @Override
    public int updateNews(News news) {
        return newsDao.updateNews(news);
    }
    @Override
    public int insertNews(News news) {
        return newsDao.insertNews(news);
    }
    @Override
    public int deleteNews(int id) {
        return newsDao.deleteNews(id);
    }

    @Override
    public News getNewsById(int id) {
        return newsDao.getNewsById(id);
    }
}
